<?php

namespace app\index\controller;

use app\common\controller\HomeBase;
use think\Db;

class Lists extends HomeBase {

    public function index() {
        $subject_id = input('param.id');
        //获取该栏目的所有题目
        $topics = [];
        $tpoic_info= Db::name('subject')->where(['id'=>$subject_id])->find();
        
        if($tpoic_info['topic_ids']){
            $topics = explode(',', trim($tpoic_info['topic_ids'],','));
        }
        
        return $this->fetch('',[
            'data'=>$topics
        ]);
    }
    
    public function lists () {
        
        return $this->fetch();
    }

}
